c# exit foreach

60

get out of foreach statement c# -

foreach (string s in sList)
{
    if (s.equals("ok"))
    {
        break; // get out of the loop
    }
}

c# exit foreach -

Use break

Comments

Submit
0 Comments